<script setup lang="ts">
// @ts-ignore
import { ref, Ref } from "vue";
// @ts-ignore
import { invoke } from "@tauri-apps/api/tauri";

const greetMsg: Ref<string> = ref("");
const name = ref("");

async function greet() {
  greetMsg.value = await invoke("greet", { name: name.value });
}



</script>

<template>
  <form class="row" @submit.prevent="greet">

    <input id="greet-input" v-model="name" placeholder="Enter a name..." />
    <button type="submit">Greet</button>
  </form>

  <p> greet: {{ greetMsg }}</p>
</template>
